package elasticsearch

import (
	"github.com/elastic/go-elasticsearch/v7"
	"github.com/zeromicro/go-zero/core/logx"
)

var Es *elasticsearch.Client

func Init() {
	var err error
	cfg := elasticsearch.Config{
		Addresses: []string{
			"http://14.103.138.112:9200",
		},
		// ...
	}
	Es, err = elasticsearch.NewClient(cfg)
	if err != nil {
		panic(err)
	}
	logx.Info("ES初始化成功")

}
